# Wrapping and stuff

# Do jpeg (8,12, 16 lossly lossless). From ijg
SET(JPEG_NAMESPACE "GDCMJPEG")
SET(JPEG_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
SET(JPEG_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
SET(JPEG_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
SUBDIRS(jpeg)

# Do expat
IF(NOT GDCM_USE_SYSTEM_EXPAT)
  SET(EXPAT_NAMESPACE "GDCMEXPAT")
  SET(EXPAT_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
  SET(EXPAT_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
  SET(EXPAT_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
  SUBDIRS(gdcmexpat)
ENDIF(NOT GDCM_USE_SYSTEM_EXPAT)

# Do openjpeg (jpeg2000 implementation)
SET(OPENJPEG_NAMESPACE "GDCMOPENJPEG")
SET(OPENJPEG_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
SET(OPENJPEG_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
SET(OPENJPEG_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
SUBDIRS(openjpeg)

# Do jpegls (JPEG-LS aka near lossless implementation)
SET(JPEGLS_NAMESPACE "GDCMJPEGLS")
SET(JPEGLS_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
SET(JPEGLS_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
SET(JPEGLS_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
#SUBDIRS(jpegls)

# Do md5
IF(GDCM_BUILD_TESTING)
IF(NOT GDCM_USE_SYSTEM_MD5)
  SET(MD5_NAMESPACE "GDCMMD5")
  SET(MD5_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
  SET(MD5_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
  SET(MD5_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
  SUBDIRS(gdcmmd5)
ENDIF(NOT GDCM_USE_SYSTEM_MD5)
ENDIF(GDCM_BUILD_TESTING)

# Do zlib
IF(NOT GDCM_USE_SYSTEM_ZLIB)
  SET(ZLIB_NAMESPACE "GDCMZLIB")
  SET(ZLIB_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
  SET(ZLIB_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
  SET(ZLIB_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
  SUBDIRS(gdcmzlib)
ENDIF(NOT GDCM_USE_SYSTEM_ZLIB)

# Do getopt
IF(WIN32 AND NOT CYGWIN)
  SET(GETOPT_NAMESPACE "GDCMGETOPT")
  SET(GETOPT_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
  SET(GETOPT_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
  SET(GETOPT_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
  SUBDIRS(getopt)
ENDIF(WIN32 AND NOT CYGWIN)

SUBDIRS(doxygen)

# you could be running mingw32 on linux in which case you do NOT want the gdcmuuid lib
IF(NOT WIN32 AND NOT MINGW)
  IF(NOT GDCM_USE_SYSTEM_UUID)
    SET(UUID_NAMESPACE "GDCMUUID")
    SET(UUID_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
    SET(UUID_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
    SET(UUID_INSTALL_LIB_DIR      ${GDCM_INSTALL_LIB_DIR})
    SUBDIRS(gdcmuuid)
  ENDIF(NOT GDCM_USE_SYSTEM_UUID)
ENDIF(NOT WIN32 AND NOT MINGW)

#IF(NOT GDCM_INSTALL_NO_DEVELOPMENT)
##  FILE(GLOB header_files "*.h" "*.txx")
#  INSTALL(FILES 
##${header_files}
#gdcm_expat.h
##gdcm_md5.h # In an install tree there should not be the need for the md5 lib...
#gdcm_openjpeg.h
#gdcm_uuid.h
#gdcm_zlib.h
#    DESTINATION ${GDCM_INSTALL_INCLUDE_DIR} COMPONENT Development
#  )
#ENDIF(NOT GDCM_INSTALL_NO_DEVELOPMENT)

